package gggjjj;

import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        double[] a1=new double[6];
        for(int i=0;i<6;i++){
            System.out.println("第"+(i+1)+"评委输入评分：");
            a1[i]=scan.nextDouble();
        }
        double qq= app(a1);
        System.out.println("平均分为："+qq);
    }

    private static double app(double[] a1) {
        double sum = 0;
        double min = a1[0];
        double max = a1[0];
        for (double a2 : a1) {
            sum += a2;
            if (a2 < min) {
                min = a2;
            }
            if (a2 > max) {
                max = a2;
            }
        }
        return (sum-min-max)/(a1.length-2);
    }
}
